<!--
 * @Description: 
 * @Version: 1.0
 * @Autor: younghxp
 * @Date: 2022-03-07 14:44:15
 * @LastEditors: younghxp
 * @LastEditTime: 2022-03-09 09:24:49
-->
<template>
  <div class="content">
    <div class="title">平台各项制度落实情况</div>
    <el-row class="detail">
      <el-col :span="4" v-for="item in detailData" :key="item.id">
        <div>
          <p class="subTitle">{{ item.title || '--' }}</p>
          <p class="num">
            {{ item.value === 0 ? 0 : item.value ? item.value + '%' : '--' }}
          </p>
        </div>
      </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  name: 'platformRule',
  data() {
    return {
      detailData: [
        {
          title: '实名制覆盖率',
          id: 'realNameCoverageScale',
          value: '',
        },
        {
          title: '实名制更新率',
          id: 'realNameUpdateScale',
          value: '',
        },
        {
          title: '工资专户开户率',
          id: 'accountOpenScale',
          value: '',
        },
        {
          title: '银行代发落实率',
          id: 'bankUndertakesScale',
          value: '',
        },
        {
          title: '工资保证金缴纳率',
          id: 'depositPayScale',
          value: '',
        },
        {
          title: '维权公示牌覆盖率',
          id: 'activistPublicityCardScale',
          value: '',
        },
      ],
    }
  },
  mounted() {
    this.getRuleSum()
  },
  methods: {
    getRuleSum() {
      return this.axios
        .post('api-s/cs/projectstats/base/findProjectSystemImplementSum')
        .then((res) => {
          if (!res.data.hasError) {
            this.detailData.forEach((v) => {
              v.value = res.data.result[v.id]
            })
          } else {
            this.$message({
              message: res.data.errorMsg,
              type: 'error',
            })
          }
        })
        .catch((error) => {
          if (error.response) {
            this.$message.error(error.response.data)
          }
        })
    },
  },
}
</script>

<style lang="less" scoped>
.content {
  margin-top: 10px;
  background-color: #fff;
  .title {
    height: 40px;
    line-height: 40px;
    border-bottom: 1px solid #e3e7e9;
    padding: 0 16px;
    color: #333;
    font-size: 16px;
    font-weight: 700;
  }
  .detail {
    height: 104px;
    padding: 16px 8px;
    .el-col {
      padding: 0 8px;
      div {
        width: 100%;
        height: 72px;
        background: #f5f7fb;
        border-radius: 4px;
        .subTitle {
          font-size: 14px;
          padding-top: 14px;
          height: 28px;
          line-height: 14px;
          color: #666;
          text-align: center;
        }
        .num {
          margin-top: 10px;
          height: 22px;
          line-height: 22px;
          font-size: 18px;
          color: #6395fa;
          text-align: center;
          font-weight: 700;
        }
      }
    }
  }
}
</style>
>
